home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / ghostscript / src / gsutil.h < prev    next >
C/C++ Source or Header  |  1994-08-01  |  2KB  |  45 lines

  1. /* Copyright (C) 1992, 1993 Aladdin Enterprises.  All rights reserved.
  2.  
  3. This file is part of Ghostscript.
  4.  
  5. Ghostscript is distributed in the hope that it will be useful, but
  6. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. to anyone for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.  Refer
  9. to the Ghostscript General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute
  12. Ghostscript, but only under the conditions described in the Ghostscript
  13. General Public License.  A copy of this license is supposed to have been
  14. given to you along with Ghostscript so you can know your rights and
  15. responsibilities.  It should be in a file named COPYING.  Among other
  16. things, the copyright notice and this notice must be preserved on all
  17. copies.  */
  18.  
  19. /* gsutil.h */
  20. /* Prototypes for procedures in gsutil.c */
  21.  
  22. /* Note: gsutil.c also implements props_extract, declared in gsprops.h. */
  23.  
  24. /* ------ String utilities ------ */
  25.  
  26. /* Compare two strings, returning -1 if the first is less, */
  27. /* 0 if they are equal, and 1 if first is greater. */
  28. /* We can't use memcmp, because we always use unsigned characters. */
  29. extern int bytes_compare(P4(const byte *, uint, const byte *, uint));
  30.  
  31. /* Test whether a string matches a pattern with wildcards. */
  32. /* If psmp == NULL, use standard parameters: '*' = any substring, */
  33. /* '?' = any character, '\\' quotes next character, don't ignore case. */
  34. typedef struct string_match_params_s {
  35.     int any_substring;        /* '*' */
  36.     int any_char;            /* '?' */
  37.     int quote_next;            /* '\\' */
  38.     int ignore_case;
  39. } string_match_params;
  40. extern int string_match(P5(const byte *str, uint len,
  41.   const byte *pstr, uint plen, const string_match_params *psmp));
  42.  
  43. /* Compute a hash for a string */
  44. extern uint string_hash(P2(const byte *, uint));
  45.